package com.innover.domain;

import com.innover.common.domain.BaseTO;
import com.innover.util.CustomDateSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 12-7-18
 * Time: 下午3:36
 * To change this template use File | Settings | File Templates.
 */
@Table(name="user_records")
@Entity
public class UserRecord extends BaseTO{
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    private int id;

    @Column(name="deviceid")
    private String deviceId;
    @Column(name="recordname")
    private String recordName;
    @Column(name="recordpath")
    private String recordPath;
    @Column(name="ass_song")
    private String assSong;
    @Column(name="ass_song_id")
    private int assSongId;
    @Column(name="upload_date")
    private Date uploadDate;
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getRecordName() {
        return recordName;
    }

    public void setRecordName(String recordName) {
        this.recordName = recordName;
    }

    public String getRecordPath() {
        return recordPath;
    }

    public void setRecordPath(String recordPath) {
        this.recordPath = recordPath;
    }

    public String getAssSong() {
        return assSong;
    }

    public void setAssSong(String assSong) {
        this.assSong = assSong;
    }

    public int getAssSongId() {
        return assSongId;
    }

    public void setAssSongId(int assSongId) {
        this.assSongId = assSongId;
    }

     @JsonSerialize(using = CustomDateSerializer.class)
    public Date getUploadDate() {
        return uploadDate;
    }

    public void setUploadDate(Date uploadDate) {
        this.uploadDate = uploadDate;
    }

    @Override
    public String toString() {
        return "UserRecord{" +
                "id=" + id +
                ", deviceId='" + deviceId + '\'' +
                ", recordName='" + recordName + '\'' +
                ", recordPath='" + recordPath + '\'' +
                ", assSong='" + assSong + '\'' +
                ", assSongId=" + assSongId +
                ", uploadDate=" + uploadDate +
                '}';
    }
}
